<template>
  <div id="app">
    <!--富文本组件化-->
    <Editor ref="froalaEditor" @on-change="changeContent"></Editor>
  </div>
</template>

<script>
import Editor from './components/editor.vue'

export default {
  name: 'App',
  components: {
    Editor
  },
  created () {
    this.init()
  },
  methods: {
    init () {
      this.$nextTick(() => {
        this.$refs.froalaEditor.setHtml('<p>我是内容<p>')
      })
    },
    changeContent (html) {
      console.log(html)
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
